package com.tanhua.commons.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import java.util.UUID;

public class FileUtils {

    public static String getFilePath(String fileName) {

        String fileFormat = fileName.substring(fileName.lastIndexOf(".")+1);

        return new SimpleDateFormat("yyyy/MM/dd/").
                format(new Date())
                + UUID.randomUUID().toString().replaceAll("-", "")
                + "."+fileFormat;
    }
}
